<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .container {
        width: 300px;
        display: flex;
        justify-content: space-between;
        flex-wrap: wrap;
      }
      .list {
        background-color: skyblue;
        margin: 10px;
      }
      /* 使用伪元素辅助左对齐 */
      .container::after {
        content: "";
        flex: auto; /* 或者flex: 1 */
      }
    </style>
  </head>
  <body>
    <div class="container">
      <div class="list" style="width: 50px; height: 50px"></div>
      <div class="list" style="width: 40px; height: 50px"></div>
      <div class="list" style="width: 60px; height: 50px"></div>
      <div class="list" style="width: 30px; height: 50px"></div>
      <div class="list" style="width: 40px; height: 50px"></div>
      <div class="list" style="width: 30px; height: 50px"></div>
      <div class="list" style="width: 70px; height: 50px"></div>
    </div>
  </body>
</html>
